package cn.iocoder.mall.user.biz.dao;

import cn.iocoder.mall.user.biz.dataobject.Feedback;
import cn.iocoder.mall.user.biz.dataobject.Member;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description: 商城用户
 * @Author: jeecg-boot
 * @Date:   2019-10-18
 * @Version: V1.0
 */
@Mapper
public interface MemberMapper extends BaseMapper<Member> {

    @Select("select id, mobile , username , is_delete , state   from `member` where mobile = #{mobile}")
    Member getOneByMobile(@Param("mobile") String mobile);
    @Select("select id, mobile , username from `member` where id = #{userId} AND username = #{username}")
    Member getOneByName(@Param("userId") String userId, @Param("username") String username);
    @Select("select id, mobile , username from `member` where mobile = #{mobile}")
    Member getUser(@Param("mobile") String mobile);
    @Update("update `member` set is_delete = 1 where id = #{id} ")
    void deleteByUserId(@Param("id") String id);

    void deleteByUserIds(@Param("list") List<String> asList);
    @Select("select mobile from `member` where id = #{id} limit 1")
    String getMobileById(@Param("id") String receiver);

    @Insert("insert into feed_back (user_id,user_name,content,create_time )values(#{userId},#{userName},#{content},#{createTime})")
    Boolean modifyFeedBack(Feedback feedback);
}
